# -*- coding: utf-8 -*-
import os
from openpyxl import load_workbook

"""
实现功能：
    批量生成文件夹
"""

original_path = 'D:/pythonProject/测试/01_学士学位论文终稿/'
look_up_table_path = 'D:/pythonProject/测试/Name_Number.xlsx'
look_up_table_row_start = 2
look_up_table_row_number = 29

# 读取excel，匹配学号：姓名
name_number_dict = {}
name_list = []
look_up_table_excel = load_workbook(look_up_table_path)
look_up_table_all_sheet = look_up_table_excel.get_sheet_names()
look_up_table_sheet = look_up_table_excel.get_sheet_by_name(look_up_table_all_sheet[0])
for i in range(look_up_table_row_start, look_up_table_row_start + look_up_table_row_number):
    number = look_up_table_sheet.cell(i, 1).value
    name = look_up_table_sheet.cell(i, 2).value
    name_list.append(name)
    name_number_dict[number] = name

for key, value in name_number_dict.items():
    path = r'D:/02_item/02_学位申请/02_2023年秋/04_学位上报材料/03_上传国开系统/' + str(key) + '_' + value
    print(path)
    os.mkdir(path)
